package com.quectel.core.module.partyeducationtraining.dto;

import com.quectel.core.module.partybuilding.dto.PartyOrganizationDto;
import com.quectel.core.module.partybuilding.dto.PartyPersonDto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @author ryan
 * @email ryan.ran@quectel.com
 * @date 2022/05/07 16:39
 */
@Data
@Schema
public class TrainingDto implements Serializable {

    /**
     *
     */
    @Schema(description = "")
    private Long id;

    /**
     * 租户id
     */
    @Schema(description = "租户id")
    private Long tenantId;

    /**
     * 党组织id
     */
    @Schema(description = "党组织id")
    private Long partyId;

    /**
     * 分类 1安防2消防3...
     */
    @Schema(description = "分类 1安防2消防3...")
    @NotNull
    @Range(min = 1, max = 3, message = "错误的课程分类")
    private Byte type;

    /**
     * 课程名称
     */
    @Schema(description = "课程名称")
    @NotEmpty
    @Length(min = 1, max = 80)
    private String name;

    /**
     * 培训目的
     */
    @Schema(description = "培训目的")
    private String purpose;

    /**
     * 培训讲师
     */
    @Schema(description = "培训讲师")
    @NotEmpty
    @Length(min = 1, max = 50)
    private String lecturer;

    /**
     * 开始时间
     */
    @Schema(description = "开始时间")
    @NotNull
    private Date startTime;

    /**
     * 结束时间
     */
    @Schema(description = "结束时间")
    @NotNull
    private Date endTime;

    /**
     * 顺序学习1是0否
     */
    @Schema(description = "顺序学习1是0否")
    @NotNull
    @Range(min = 0, max = 1)
    private Byte orderLearnFlag;

    /**
     * 开启前几分钟推送
     */
    @Schema(description = "开启前几分钟推送")
    @Range(min = 0, max = 1440, message = "仅能提前一天推送")
    private Integer pushBeforeLearnMins;

    /**
     * 推送类型数组1短信2微信 [1,2]
     */
    @Schema(description = "推送类型数组1短信2微信 [1,2]")
    private String pushType;

    /**
     * 推送状态0未推送1已推送
     */
    @Schema(description = "推送状态0未推送1已推送")
    private Byte pushStatus;

    /**
     * 发布状态 1上架0下架
     */
    @Schema(description = "发布状态 1上架0下架")
    @NotNull
    @Range(min = 0, max = 1)
    private Byte publishStatus;

    /**
     * 封面图url
     */
    @Schema(description = "封面图url")
    private String coverImg;

    /**
     * 课程描述富文本
     */
    @Schema(description = "课程描述富文本")
    private String description;

    /**
     * 课时数量 注意加锁更新
     */
    @Schema(description = "课时数量 注意加锁更新")
    private Integer trainingItemCount;

    /**
     * 培训总人员数
     */
    @Schema(description = "培训总人员数")
    private Integer trainingPersonCount;

    /**
     * 培训完成的人员数量
     */
    @Schema(description = "培训完成的数量")
    private Integer trainingCompletePersonCount;

    /**
     * 课程培训评价数量
     */
    @Schema(description = "课程培训评价数量")
    private Integer trainingCommentCount;

    /**
     * 课程培训心得数量
     */
    @Schema(description = "课程培训心得数量")
    private Integer trainingExperienceCount;

    /**
     * 创建人
     */
    @Schema(description = "创建人")
    private String creator;

    /**
     * 创建时间
     */
    @Schema(description = "创建时间")
    private Date createTime;

    /**
     * 修改人
     */
    @Schema(description = "修改人")
    private String editor;

    /**
     * 修改时间
     */
    @Schema(description = "修改时间")
    private Date editTime;

    /************非数据库字段 start ************/
    @Schema(description = "党组织信息")
    private PartyOrganizationDto party;
    @Schema(description = "人员ids")
    private Long[] personIds;
    @Schema(description = "人员信息")
    private List<PartyPersonDto> persons;
    @Schema(description = "课程状态")
    private Byte status;
    /************非数据库字段 end **************/
}
